package com.chance.cc.crawler.prod.command.job.domain.news.toutiao;

import com.chance.cc.crawler.core.record.CrawlerRequestRecord;
import com.chance.cc.crawler.prod.command.job.domain.news.NewsCommonScript;
import org.apache.commons.lang3.StringUtils;

import static com.chance.cc.crawler.core.CrawlerEnum.CrawlerRequestType.*;

/**
 * @author lt
 * @version 1.0
 * @date 2021-04-12 16:30:40
 * @email okprog@sina.com
 */
public class TTCommonScript extends NewsCommonScript {
    public static final String domain = "toutiao";
    public static final String site = "searchkw";
    public static final String kwSite = "search_keyword";

    public static CrawlerRequestRecord getKwRecord(String metaSite){
        //keyword record
        return CrawlerRequestRecord.builder()
                .startPageRequest(StringUtils.joinWith("-",domain, site),turnPageItem)
                .httpUrl("http://"+metaServiceIp+":"+metaServicePort+"/v1/meta/"+domain+"/keys?site=" + metaSite)
                .requestLabelTag(supportSource)
                .requestLabelTag(internalDownload)
                .build();
    }
}
